package com.travel.Service.Impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.travel.Bean.Culture;
import com.travel.Bean.Feedback;
import com.travel.JPA.FeedbackJPA;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FeedbackServiceImpl {

    @Autowired
    private FeedbackJPA feedbackJPA;

    /**
     * 得到反馈所有列表
     *
     * @param cultureId 景区id
     * @param page      页面
     * @param limit     记录条数
     * @return {@link PageInfo}<{@link Feedback}>
     */
    public PageInfo<Feedback> getFeedbackAllList(Integer cultureId,Integer page,Integer limit){
        PageHelper.startPage(page,limit);
        List<Feedback> feedbacks = feedbackJPA.findAllByCultureId(cultureId);
        return new PageInfo<>(feedbacks);
    }



}
